// 鼠标划入分页，让show显示，离开就隐藏
$('.leifen').on('mouseover',function(){
    $('.category-box').stop().fadeIn()
    
})


Show()
function Show() {
    $.ajax({
        url: 'https://www.ymatou.hk/guess/api/getCategoryBigList',
        
        data: {
            callback:'jQuery112406788455137224783_1635692088815',
          _: +new Date()
        },
        dataType: 'jsonp',
        success: res => {
            var data = res.result
            // console.log(data)
            var str = ''
            data.forEach(item => {
                // console.log(item.subTitle)
                str += `
                <div class="cw-item">
                    <a href="./list.html" title=" ${item.title}">
                        <h3 class="cw-title">
                            ${item.title}
                        </h3>
                        <div class="cw-subtitle">
                        `
                     for (var attr in item.subTitle){
                         str += ` <span>${item.subTitle[attr]}</span>`
                    }
                       str += `
                        </div>
                        <span class="cw-img">
                            <img src="${item.pic}" alt="">
                        </span>
                    </a>
                </div>  `
                document.querySelector('.category-wrap').innerHTML=str
            });
            //  console.log(data)
        }
    })
}
  
// 鼠标离开，让盒子隐藏
$('.leifen').on('mouseout', function () {
    // $('.category-box .cw-item').on('click',function () {
            $('.category-box').stop().fadeOut()
    // }) 
})